import java.net.URLDecoder;
import java.net.URLEncoder;

public class URLDecoderTest {
    public static void main(String[] args) throws Exception {
        // 将 application/x-www-form-urlencoded 转换成普通字符串
        String keyWord = URLDecoder.decode("%E7%96%AF%E7%8B%82java", "utf-8");
        System.out.println(keyWord);
        // 将普通字符串转换成 application/x-www-form-urlencoded
        String urlStr = URLEncoder.encode("Java网络编程", "GBK");
        System.out.println(urlStr);
    }
}
